package edu.gdkm;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.stereotype.Component;

@Data     //getter/setter、toString
@AllArgsConstructor     //构造方法
@NoArgsConstructor
@Component
public class Teacher {
    @Value("张三")
    private String name;
    @Value("Java")
    private String course;
    public void teach(){
        System.out.println(name+"教授课程："+course+"...");
    }
}